{include file="./layout/header.html" /}
<body>
<div class="x-nav">
  <!--<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:left" onClick="javaScript:history.go(-1)" title="返回">-->
    <!--<i class="layui-icon" style="line-height:30px">&#xe65c;</i></a>-->

  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
    <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">


  <table class="layui-table">
    <thead>
    <tr>
      <th>排序</th>
      {if condition="$intrs.0.lm eq 0"}
      <th>标题</th>
      <th>title</th>
      {else /}
      {/if}
      {if condition="$intrs.0.lm eq 1"}
      <th>标题</th>
      {else /}
      {/if}
      {if condition="$intrs.0.lm eq 2"}
      <th>title</th>
      {else /}
      {/if}
      <th>添加时间</th>
      <!--<th>修改时间</th>-->
      <th>状态</th>
      <th>选择</th>
    </thead>
    <?php $num = 0 ?>
    <tbody id="contentbody">
    {volist name="intrs.0.intr" id="v"}
    <tr>
      <td><?php echo $num; $num++; ?></td>
      {if condition="$intrs.0.lm eq 0"}
      <td>{$v->translations[1]->name}</td>
      <td>{$v->translations[0]->name}</td>
      {else /}
      {/if}
      {if condition="$intrs.0.lm eq 1"}
      <td>{$v->translations[1]->name}</td>
      {else /}
      {/if}
      {if condition="$intrs.0.lm eq 2"}
      <td>{$v->translations[0]->name}</td>
      {else /}
      {/if}
      <td><?php echo  date("Y-m-d H:i",$v->created_at)?></td>

      <td class="td-status">
        {if condition="$v->status eq 1"}
        <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span>
        {else /}
        <span class="layui-btn layui-btn-normal layui-btn-mini layui-btn-disabled">已停用</span>
        {/if}
      </td>

      <td class="td-manage">
        <!--<a onclick="member_stop(this,'10001')" href="javascript:;"  title="启用">-->
          <!--<i class="layui-icon">&#xe601;</i>-->
        <!--</a>-->
        <div class="layui-form-onswitch"></div>
        <div class="layui-unselect layui-form-checkbox " lay-skin="primary" data-id='{$v->uid}' style="opacity: 0;width: 100%;height: 100%;"><i class="layui-icon">&#xe605;</i></div>

      </td>
    </tr>
    {/volist}
    </tbody>
  </table>
  <div class="page">
    <div id="demo3"></div>
  </div>

</div>

<script type="text/javascript" src="__CDN__/admin/news/js/newsList.js" charset="utf-8"></script>
<script>


    //给父页面传递选中的值
    $('.layui-form-checkbox').on('click', function(e){
        console.log(e);
        var $this=e.currentTarget;//你点击的对象
        console.log($this.classList);
        if(!$($this.classList).hasClass('layui-form-checked')){
            // $($this.classList).addClass("layui-form-checked");
            $($this).addClass("layui-form-checked");
            var id =  jQuery(".layui-form-checked").data('id');
            console.log(id);
            parent.$('#target_id').val(id);

        }else{
            $($this.classList).removeClass('layui-form-checked');
        }



        // parent.layer.tips('Look here', '#parentIframe', {time: 5000});
        // parent.layer.close(parent.layer.getFrameIndex(window.name));
    });
</script>
{include file="./layout/footer.html" /}